package my_servlet;

import jakarta.servlet.*;

import java.io.IOException;
import java.io.PrintWriter;

public class servlet_01 implements Servlet {
    @Override
    public void init(ServletConfig servletConfig) throws ServletException {

    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        servletResponse.setContentType("tex/html");//需要写在获取对象之前
        PrintWriter out = servletResponse.getWriter();
        out.print("<h1>hello boy!</h1>");
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {

    }
}
